package org.example3;

import org.example2.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 验证getBean()
 * 通过Id和通过 name
 *
 *  id和name都必须要唯一才行
 *
 */
public class AppIdNameDifference {
    public static void main(String[] args) {

        ApplicationContext applicationContext = new ClassPathXmlApplicationContext
                ("applicationContext-IdName.xml");
        Object bean = applicationContext.getBean("beanOwn3");
        System.out.println(bean);


    }
}
